package com.gitee.wsl.prism4j

class SyntaxImpl(
    private val type: String,
    private val children: MutableList<out Prism4j.Node>,
    private val alias: String?,
    private val matchedString: String,
    private val greedy: Boolean,
    private val tokenized: Boolean
) : Prism4j.Syntax {

    override fun textLength(): Int {
        return matchedString.length
    }

    override fun type(): String {
        return type
    }

    override fun children(): MutableList<out Prism4j.Node> {
        return children
    }

    override fun alias(): String? {
        return alias
    }

    override fun matchedString(): String {
        return matchedString
    }

    override fun greedy(): Boolean {
        return greedy
    }

    override fun tokenized(): Boolean {
        return tokenized
    }

    override fun toString(): String {
        return "SyntaxImpl{" +
                "type='" + type + '\'' +
                ", children=" + children +
                ", alias='" + alias + '\'' +
                ", matchedString='" + matchedString + '\'' +
                ", greedy=" + greedy +
                ", tokenized=" + tokenized +
                '}'
    }
}
